package com.csun.cmny.provider.service;

import com.csun.cmny.base.dto.LoginAuthDto;
import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.OmcServiceOrder;
import com.csun.cmny.provider.model.dto.*;
import com.csun.cmny.provider.model.dto.service.GetOrderByAssignDto;
import com.csun.cmny.provider.model.dto.service.LongRangeServiceOrderCountDto;
import com.csun.cmny.provider.model.dto.service.ServiceOrderCountDto;
import com.csun.cmny.provider.model.dto.service.ServiceOrderOperationDto;
import com.csun.cmny.provider.model.vo.MerchantCountVO;
import com.csun.cmny.provider.model.vo.OrderCountVO;
import com.csun.cmny.provider.model.vo.ServiceOrderDetailsVo;
import com.csun.cmny.provider.model.vo.ServiceOrderVO;
import com.csun.cmny.provider.model.vo.service.ServiceCountStatusVo;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface OmcServiceOrderService extends IService<OmcServiceOrder> {

    /*
    * 添加订单
    * */
    String addServiceOrder(ServiceOrderDto serviceOrderDto, LoginAuthDto loginAuthDto);

    /*
    * 接单
    * */
    Integer getServiceOrder(GetOrderDto getOrderDto, LoginAuthDto loginAuthDto);

    /*
    * 指派
    * */
    Integer assignServiceOrder(GetOrderByAssignDto getOrderDto, LoginAuthDto loginAuthDto);

    /*
    * 撤单
    * */
    Integer retreatServiceOrder(Long orderId, LoginAuthDto loginAuthDto);

    /*
     * 撤单
     * */
    Integer retreatServiceOrderByTaker(Long orderId, LoginAuthDto loginAuthDto);

    /*
    * 完成订单
    * */
    Integer completeServiceOrder(Long orderId, LoginAuthDto loginAuthDto);

    /*
    * 分页查询
    * */
    PageInfo listPage(ServiceOrderQueryDto serviceOrderQueryDto);

    /*
     * 分页查询待抢单
     * */
    PageInfo listOrderPage(OmcAddressDto omcAddressDto);

    /*
     * 分页查询历史订单
     * */
    PageInfo listServicedOrder(OmcServicedOrderDto omcServicedOrderDto);

    /*
     * 获取总佣金
     * */
    Double getTotalCommission(OmcServicedOrderDto omcServicedOrderDto);

    /*
    * 订单详情
    * */
    ServiceOrderVO detail(Long orderId, LoginAuthDto loginAuthDto);

    /*
     * 订单详情
     * */
    ServiceOrderDetailsVo orderDetail(Long orderId, LoginAuthDto loginAuthDto);

    /*
    * 商家确认
    * */
    Integer ensure(Long orderId, LoginAuthDto loginAuthDto);

    /*
    * 订单统计
    * */
    List<OrderCountVO> orderCount(CountQueryDTO countQueryDTO);

    /*
    * 商家统计
    * */
    List<MerchantCountVO> merchantCount(CountQueryDTO countQueryDTO);

    /**
     * 查询待服务列表
     *
     * @param
     *
     * @return
     */
    List<ServiceOrderVO> showWaitServiceTask(ServiceOrderQueryDto serviceOrderQueryDto,LoginAuthDto loginAuthDto);

    /**
     * 助餐 - 到店打卡
     *
     * @param
     *
     * @return
     */
    Integer checkInById(ServiceOrderOperationDto serviceOrderOperationDto, LoginAuthDto loginAuthDto);


    /**
     * 助餐 - 离开打卡
     *
     * @param
     *
     * @return
     */
    Integer checkOutById(ServiceOrderOperationDto serviceOrderOperationDto, LoginAuthDto loginAuthDto);

    List<ServiceCountStatusVo> selectOrderNumbersByStatus(ServiceOrderCountDto serviceOrderCountDto);

    List<ServiceCountStatusVo> selectlongRangeOrderNumbersByStatus(LongRangeServiceOrderCountDto longRangeServiceOrderCountDto);

    int pay(Long id);

    Integer selectHaveUnfinishedOrderNumbers(Long userId);
}
